Skip to content

UCT-731: Added inspection call non-interface method #796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

bohdan-harniuk
Copy link
Collaborator

Description (*)

What was done:

  • added new inspection: called non-interface method

Data used during final testing:

Reference API
\Magento\Customer\Api\CustomerRepositoryInterface.get 🟢
\Magento\Customer\Api\AccountManagementInterface.sendPasswordResetConfirmationEmail 🔴

Tested class:

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Foo\Bar\Model;

use Magento\Customer\Api\AccountManagementInterface;
use Magento\Customer\Api\CustomerRepositoryInterface;

class Ga
{
    /**
     * @var AccountManagementInterface
     */
    private $accountManagement;

    /**
     * @var CustomerRepositoryInterface
     */
    private $customerRepository;

    /**
     * @param CustomerRepositoryInterface $customerRepository
     * @param CustomerRepository $customerRepositoryImpl
     */
    public function __construct(
        AccountManagementInterface $accountManagement,
        CustomerRepositoryInterface $customerRepository
    ) {
        $this->accountManagement = $accountManagement;
        $this->customerRepository = $customerRepository;
    }

    public function test(): void
    {
        $customer = $this->customerRepository->get("test@gmail.com");
        $this->accountManagement->sendPasswordResetConfirmationEmail($customer);
    }
}

Results:

Action execution:

Screenshot 2021-11-23 at 17 46 51

Realtime:

Screenshot 2021-11-23 at 17 47 01

Visual analysis:

Screenshot 2021-11-23 at 17 47 22

Fixed Issues (if relevant)

  1. Fixes [UCT:Inspection] Call to non-interface method (that is present in implementation) #731

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with integration/functional tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Copy link
Collaborator

@andrewbess andrewbess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @bohdan-harniuk
Thank you for your contribution
Approved ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UCT:Inspection] Call to non-interface method (that is present in implementation)
3 participants